package demo1225.am;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

/*
 public  InputStreamReader(InputStream is,String charsetName);
 */
public class Demo_01 {
    public static void main(String[] args) {
        try (InputStreamReader is = new InputStreamReader
                (new FileInputStream("a.html"),"GBK")) {
            int read ;
            while ((read = is.read())!=-1){
                System.out.print((char)read);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
